#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	char ch, x = 'a';//
	int num = 0;
	do
	{
		num++;
		ch = getchar();//
		if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9'))
		{
			printf("%c", ch);//
		}
		else
		{
			if (ch != x) printf("%c", ch);//
		}
		x = ch;
	} while (ch != 10 && num < 50);//

	return 0;
}